{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport Input from \"./Input\";\nimport { getTitle } from \"../utils/commonUtil\";\nvar SingleSelector = function SingleSelector(props) {\n  var inputElement = props.inputElement,\n    prefixCls = props.prefixCls,\n    id = props.id,\n    inputRef = props.inputRef,\n    disabled = props.disabled,\n    autoFocus = props.autoFocus,\n    autoComplete = props.autoComplete,\n    activeDescendantId = props.activeDescendantId,\n    mode = props.mode,\n    open = props.open,\n    values = props.values,\n    placeholder = props.placeholder,\n    tabIndex = props.tabIndex,\n    showSearch = props.showSearch,\n    searchValue = props.searchValue,\n    activeValue = props.activeValue,\n    maxLength = props.maxLength,\n    onInputKeyDown = props.onInputKeyDown,\n    onInputMouseDown = props.onInputMouseDown,\n    onInputChange = props.onInputChange,\n    onInputPaste = props.onInputPaste,\n    onInputCompositionStart = props.onInputCompositionStart,\n    onInputCompositionEnd = props.onInputCompositionEnd;\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    inputChanged = _React$useState2[0],\n    setInputChanged = _React$useState2[1];\n  var combobox = mode === 'combobox';\n  var inputEditable = combobox || showSearch;\n  var item = values[0];\n  var inputValue = searchValue || '';\n  if (combobox && activeValue && !inputChanged) {\n    inputValue = activeValue;\n  }\n  React.useEffect(function () {\n    if (combobox) {\n      setInputChanged(false);\n    }\n  }, [combobox, activeValue]); // Not show text when closed expect combobox mode\n\n  var hasTextInput = mode !== 'combobox' && !open && !showSearch ? false : !!inputValue; // Get title\n\n  var title = getTitle(item);\n  var renderPlaceholder = function renderPlaceholder() {\n    if (item) {\n      return null;\n    }\n    var hiddenStyle = hasTextInput ? {\n      visibility: 'hidden'\n    } : undefined;\n    return /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-selection-placeholder\"),\n      style: hiddenStyle\n    }, placeholder);\n  };\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n    className: \"\".concat(prefixCls, \"-selection-search\")\n  }, /*#__PURE__*/React.createElement(Input, {\n    ref: inputRef,\n    prefixCls: prefixCls,\n    id: id,\n    open: open,\n    inputElement: inputElement,\n    disabled: disabled,\n    autoFocus: autoFocus,\n    autoComplete: autoComplete,\n    editable: inputEditable,\n    activeDescendantId: activeDescendantId,\n    value: inputValue,\n    onKeyDown: onInputKeyDown,\n    onMouseDown: onInputMouseDown,\n    onChange: function onChange(e) {\n      setInputChanged(true);\n      onInputChange(e);\n    },\n    onPaste: onInputPaste,\n    onCompositionStart: onInputCompositionStart,\n    onCompositionEnd: onInputCompositionEnd,\n    tabIndex: tabIndex,\n    attrs: pickAttrs(props, true),\n    maxLength: combobox ? maxLength : undefined\n  })), !combobox && item && !hasTextInput && /*#__PURE__*/React.createElement(\"span\", {\n    className: \"\".concat(prefixCls, \"-selection-item\"),\n    title: title\n  }, item.label), renderPlaceholder());\n};\nexport default SingleSelector;","map":{"version":3,"names":["_slicedToArray","React","pickAttrs","Input","getTitle","SingleSelector","props","inputElement","prefixCls","id","inputRef","disabled","autoFocus","autoComplete","activeDescendantId","mode","open","values","placeholder","tabIndex","showSearch","searchValue","activeValue","maxLength","onInputKeyDown","onInputMouseDown","onInputChange","onInputPaste","onInputCompositionStart","onInputCompositionEnd","_React$useState","useState","_React$useState2","inputChanged","setInputChanged","combobox","inputEditable","item","inputValue","useEffect","hasTextInput","title","renderPlaceholder","hiddenStyle","visibility","undefined","createElement","className","concat","style","Fragment","ref","editable","value","onKeyDown","onMouseDown","onChange","e","onPaste","onCompositionStart","onCompositionEnd","attrs","label"],"sources":["/data/messenger.client/node_modules/rc-select/es/Selector/SingleSelector.js"],"sourcesContent":["import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport * as React from 'react';\nimport pickAttrs from \"rc-util/es/pickAttrs\";\nimport Input from \"./Input\";\nimport { getTitle } from \"../utils/commonUtil\";\n\nvar SingleSelector = function SingleSelector(props) {\n  var inputElement = props.inputElement,\n      prefixCls = props.prefixCls,\n      id = props.id,\n      inputRef = props.inputRef,\n      disabled = props.disabled,\n      autoFocus = props.autoFocus,\n      autoComplete = props.autoComplete,\n      activeDescendantId = props.activeDescendantId,\n      mode = props.mode,\n      open = props.open,\n      values = props.values,\n      placeholder = props.placeholder,\n      tabIndex = props.tabIndex,\n      showSearch = props.showSearch,\n      searchValue = props.searchValue,\n      activeValue = props.activeValue,\n      maxLength = props.maxLength,\n      onInputKeyDown = props.onInputKeyDown,\n      onInputMouseDown = props.onInputMouseDown,\n      onInputChange = props.onInputChange,\n      onInputPaste = props.onInputPaste,\n      onInputCompositionStart = props.onInputCompositionStart,\n      onInputCompositionEnd = props.onInputCompositionEnd;\n\n  var _React$useState = React.useState(false),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      inputChanged = _React$useState2[0],\n      setInputChanged = _React$useState2[1];\n\n  var combobox = mode === 'combobox';\n  var inputEditable = combobox || showSearch;\n  var item = values[0];\n  var inputValue = searchValue || '';\n\n  if (combobox && activeValue && !inputChanged) {\n    inputValue = activeValue;\n  }\n\n  React.useEffect(function () {\n    if (combobox) {\n      setInputChanged(false);\n    }\n  }, [combobox, activeValue]); // Not show text when closed expect combobox mode\n\n  var hasTextInput = mode !== 'combobox' && !open && !showSearch ? false : !!inputValue; // Get title\n\n  var title = getTitle(item);\n\n  var renderPlaceholder = function renderPlaceholder() {\n    if (item) {\n      return null;\n    }\n\n    var hiddenStyle = hasTextInput ? {\n      visibility: 'hidden'\n    } : undefined;\n    return /*#__PURE__*/React.createElement(\"span\", {\n      className: \"\".concat(prefixCls, \"-selection-placeholder\"),\n      style: hiddenStyle\n    }, placeholder);\n  };\n\n  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"span\", {\n    className: \"\".concat(prefixCls, \"-selection-search\")\n  }, /*#__PURE__*/React.createElement(Input, {\n    ref: inputRef,\n    prefixCls: prefixCls,\n    id: id,\n    open: open,\n    inputElement: inputElement,\n    disabled: disabled,\n    autoFocus: autoFocus,\n    autoComplete: autoComplete,\n    editable: inputEditable,\n    activeDescendantId: activeDescendantId,\n    value: inputValue,\n    onKeyDown: onInputKeyDown,\n    onMouseDown: onInputMouseDown,\n    onChange: function onChange(e) {\n      setInputChanged(true);\n      onInputChange(e);\n    },\n    onPaste: onInputPaste,\n    onCompositionStart: onInputCompositionStart,\n    onCompositionEnd: onInputCompositionEnd,\n    tabIndex: tabIndex,\n    attrs: pickAttrs(props, true),\n    maxLength: combobox ? maxLength : undefined\n  })), !combobox && item && !hasTextInput && /*#__PURE__*/React.createElement(\"span\", {\n    className: \"\".concat(prefixCls, \"-selection-item\"),\n    title: title\n  }, item.label), renderPlaceholder());\n};\n\nexport default SingleSelector;"],"mappings":"AAAA,OAAOA,cAAc,MAAM,0CAA0C;AACrE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,sBAAsB;AAC5C,OAAOC,KAAK,MAAM,SAAS;AAC3B,SAASC,QAAQ,QAAQ,qBAAqB;AAE9C,IAAIC,cAAc,GAAG,SAASA,cAAc,CAACC,KAAK,EAAE;EAClD,IAAIC,YAAY,GAAGD,KAAK,CAACC,YAAY;IACjCC,SAAS,GAAGF,KAAK,CAACE,SAAS;IAC3BC,EAAE,GAAGH,KAAK,CAACG,EAAE;IACbC,QAAQ,GAAGJ,KAAK,CAACI,QAAQ;IACzBC,QAAQ,GAAGL,KAAK,CAACK,QAAQ;IACzBC,SAAS,GAAGN,KAAK,CAACM,SAAS;IAC3BC,YAAY,GAAGP,KAAK,CAACO,YAAY;IACjCC,kBAAkB,GAAGR,KAAK,CAACQ,kBAAkB;IAC7CC,IAAI,GAAGT,KAAK,CAACS,IAAI;IACjBC,IAAI,GAAGV,KAAK,CAACU,IAAI;IACjBC,MAAM,GAAGX,KAAK,CAACW,MAAM;IACrBC,WAAW,GAAGZ,KAAK,CAACY,WAAW;IAC/B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